<template>
  <div>
    <van-field label="小说" v-model="name"></van-field>
    <van-button round @click="add">添加</van-button>

  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: "add_wenzhang",
  data() {
    return {
      name: '',
      userid: localStorage.getItem('userid')
    }
  },
  methods: {
    add() {
      axios.post('/zuoye/xiaoshuo', {'name': this.name, 'userid': this.userid})
          .then(res => {
            if (res.data.code == 200) {
              alert('添加成功')
            }
          })
    }
  }

}
</script>

<style scoped>

</style>